In this video we are going to analyze our 100000 portfolios with these sharp Ray saw and we have still
here our summary data frame with our six stocks and the annualized risk and return and the same we have
for our 100000 portfolios.
So here we have the data frame portfolio summary and actually for both data frames we can add to the
column shop where we calculate actually the shop ratio which is simply the return minus the return of
the risk free asset which is here one point seven percent and this is also called the risk premium.
And then we divide the risk premium by the portfolio risk.
So we are doing this for the summary data frame as well as for the portfolio summary data frame so let's
have a look first at the summary data frame.
So we on the right hand side.
We have now the sharp ratio and actually the higher the sharp ratio the better the risk adjusted return
or performance.
So the best performance has had the Microsoft stock within Sharpe ratio of one.
Then we have here Emmerson and we have IBM with a negative Sharpe ratio.
So the return of the IBM stock itself was already negative minus 4 percent.
And if you subtract one point seven percent from minus 4 percent then in the end it's no surprise that
we get a negative Sharpe ratio.
And now let's also create here the sharp column for our 100000 portfolios and let's have a look at the
first five portfolios.
So here we have portfolios with sharp ratios from 0 point 5 7 to 1 point 0 3.
And let's also call here the informal method so we have 100000 portfolios and three columns.
And let's also call here the described method and here we can see that the mean are the ever at Sharpe
ratio is 0 point 8 5 and the portfolio with the lowest Sharpe ratio has a sharp ratio of minus 0 point
0 1 and we have also a highest Sharpe Ratio of one point eighteen and in the next step we can also visualize
this OP ratio and we actually created a scatter plot again with our 100000 portfolios and our stocks
like here.
So we create the same graph but we will create kind of a three dimensional graph.
So the third dimension will be the sharp ratio and therefore we to see for each and every point a color
that reflects the top ratio of the point.
So let's do this here
so we are again plotting our portfolio summary data frame with the risk on the x axis and the return
on the y axis and the size of each dot or point is 20.
And then we also define the color of each point or dot and the color is determined by the column sharp
and we also define a color map which is a cool warm so high Sharpe Ratios will have a red color and
a low Sharpe Ratios will have a blue color and we can also scale our color maps so we can say that all
portfolios with a sharp ratio of four point seventy six and lower deep blue and all portfolios with
a sharp ratio of one point one eight or higher.
Deep Red.
So setting here the optimal values for women and we mix this kind of a trial and error process and by
doing so we can actually optimize our graph and optimize.
The message of our graph and then we also created a color bar.
And in addition we also create the points that dots for our six stocks here.
So this is nothing new with a size or 50.
And the black color and let's simply run here.
So
so here we have our shop race so and still on the x axis that we have the annualized risk in terms of
standard deviation and the annualized return here on the y axis.
And here we have all of our portfolios and our stocks and the color of the dots here give us the information
about the shop ratio so high shop ratios are here in the dark red color and the low shop ratios are
here in dark blue color and we can see here that portfolios with the highest chop ratio are in this
area here so from a risk and return perspective these are the best portfolios and you will see in later
videos why this is the case and we get a graphical intuition on this here but for the time being we
can also include our stocks here and to the color bar and give the color corresponding to their Sharpe
ratio.
So this is actually quite similar in addition.
So here we are defining the dots are the points for our stocks and also here we include the color perimeter
and we include our stocks into the color bar.
So let's have a look again here
and if you can see that investing in single stocks might not reside in the best chop ratios.
So here we offer the Amazon stock and some other stocks here.
And I think two stocks are somewhere here and we can also see here that there might be a curve here
which marks actually the optimal portfolios for a given amount of risk so having a given amount of risks
for example 0.01 5 that's a portfolio that actually gives us the highest possible return.
So here and having a given level of return.
So for example 20 percent.
That's actually one portfolio that actually realizes this return with the lowest possible risk.
So this portfolio here and actually all portfolios on this curve here actually form the efficient frontier.
And we can also plot here the efficient frontier.
So in the background I have created the efficient frontier.
So this is clearly beyond the scope of this cost because uh we use some kind of optimization algorithms
but uh to show you the efficient frontier.
So let's simply plot it here
and here in black we can see the efficient frontier and actually at one particular portfolio on this
efficient frontier is actually the portfolio with the highest Sharpe Ratio man in the next video.
We will identify the maximum shop raised for portfolio.
So I hope to see you there by.